package com.learn.util.log;

import org.slf4j.Marker;
import org.slf4j.helpers.MessageFormatter;

/**
 * 功能：平台日志记录器
 *
 * @author wsh
 * @date 2021/1/25
 */
public class PlatformLogger implements Logger {

    private org.slf4j.Logger logger = null;

    public PlatformLogger(org.slf4j.Logger logger) {
        this.logger = logger;
    }

    /**
     * 功能：构造日志事件
     *
     * @param logType
     * @param level
     * @param message
     * @param params
     * @param optId
     * @param optName
     * @return
     * @author wsh
     * @date 2021/1/25
     */
    private LoggingEvent buildEvent(int logType, String level, String message, Object[] params, Long optId, String optName) {
        LoggingEvent event = new LoggingEvent();
        event.setOperatorId(optId);
        event.setOperatorName(optName);
        event.setClassName(getName());
        event.setContent(MessageFormatter.arrayFormat(message, params).getMessage());
        event.setTime(System.currentTimeMillis());
        event.setLevel(level);
        event.setType(logType);

        StackTraceElement[] stack = new Throwable().getStackTrace();
        for (int i = 0; i < stack.length; i++) {
            StackTraceElement s = stack[i];
            if (!PlatformLogger.class.getName().equals(s.getClassName())) {
                event.setMethod(s.getMethodName());

                break;
            }
        }

        return event;
    }

    private LoggingEvent buildEvent(int logType, LoggerExtData extData, String level, String message, Object params[], Long optId, String optName) {
        LoggingEvent event = buildEvent(logType, level, message, params, optId, optName);
        event.setExtData(extData.getExtData());

        return event;
    }

    @Override
    public void debug(String s) {
        logger.debug(s);
    }

    @Override
    public void debug(String s, Object obj) {
        logger.debug(s, obj);
    }

    @Override
    public void debug(String s, Object... aobj) {
        logger.debug(s, aobj);
    }

    @Override
    public void debug(String s, Throwable throwable) {
        logger.debug(s, throwable);
    }

    @Override
    public void debug(Marker marker, String s) {
        logger.debug(marker, s);
    }

    @Override
    public void debug(String s, Object obj, Object obj1) {
        logger.debug(s, obj, obj1);
    }

    @Override
    public void debug(Marker marker, String s, Object obj) {
        logger.debug(marker, s, obj);
    }

    @Override
    public void debug(Marker marker, String s, Object... aobj) {
        logger.debug(marker, s, aobj);
    }

    @Override
    public void debug(Marker marker, String s, Throwable throwable) {
        logger.debug(marker, s, throwable);
    }

    @Override
    public void debug(Marker marker, String s, Object obj, Object obj1) {
        logger.debug(marker, s, obj, obj1);
    }

    @Override
    public void error(String s) {
        logger.error(s);
    }

    @Override
    public void error(String s, Object obj) {
        logger.error(s, obj);
    }

    @Override
    public void error(String s, Object... aobj) {
        logger.error(s, aobj);
    }

    @Override
    public void error(String s, Throwable throwable) {
        logger.error(s, throwable);
    }

    @Override
    public void error(Marker marker, String s) {
        logger.error(marker, s);
    }

    @Override
    public void error(String s, Object obj, Object obj1) {
        logger.error(s, obj, obj1);
    }

    @Override
    public void error(Marker marker, String s, Object obj) {
        logger.error(marker, s, obj);
    }

    @Override
    public void error(Marker marker, String s, Object... aobj) {
        logger.error(marker, s, aobj);
    }

    @Override
    public void error(Marker marker, String s, Throwable throwable) {
        logger.error(marker, s, throwable);
    }

    @Override
    public void error(Marker marker, String s, Object obj, Object obj1) {
        logger.error(marker, s, obj, obj1);
    }

    @Override
    public String getName() {
        return logger.getName();
    }

    @Override
    public void info(String s) {
        logger.info(s);
    }

    @Override
    public void info(String s, Object obj) {
        logger.info(s, obj);
    }

    @Override
    public void info(String s, Object... aobj) {
        logger.info(s, aobj);
    }

    @Override
    public void info(String s, Throwable throwable) {
        logger.info(s, throwable);
    }

    @Override
    public void info(Marker marker, String s) {
        logger.info(marker, s);
    }

    @Override
    public void info(String s, Object obj, Object obj1) {
        logger.info(s, obj, obj1);
    }

    @Override
    public void info(Marker marker, String s, Object obj) {
        logger.info(marker, s, obj);
    }

    @Override
    public void info(Marker marker, String s, Object... aobj) {
        logger.info(marker, s, aobj);
    }

    @Override
    public void info(Marker marker, String s, Throwable throwable) {
        logger.info(marker, s, throwable);
    }

    @Override
    public void info(Marker marker, String s, Object obj, Object obj1) {
        logger.info(marker, s, obj, obj1);
    }

    @Override
    public boolean isDebugEnabled() {
        return logger.isDebugEnabled();
    }

    @Override
    public boolean isDebugEnabled(Marker marker) {
        return logger.isDebugEnabled(marker);
    }

    @Override
    public boolean isErrorEnabled() {
        return logger.isErrorEnabled();
    }

    @Override
    public boolean isErrorEnabled(Marker marker) {
        return logger.isErrorEnabled(marker);
    }

    @Override
    public boolean isInfoEnabled() {
        return logger.isInfoEnabled();
    }

    @Override
    public boolean isInfoEnabled(Marker marker) {
        return logger.isInfoEnabled(marker);
    }

    @Override
    public boolean isTraceEnabled() {
        return logger.isTraceEnabled();
    }

    @Override
    public boolean isTraceEnabled(Marker marker) {
        return logger.isTraceEnabled(marker);
    }

    @Override
    public boolean isWarnEnabled() {
        return logger.isWarnEnabled();
    }

    @Override
    public boolean isWarnEnabled(Marker marker) {
        return logger.isWarnEnabled(marker);
    }

    @Override
    public void trace(String s) {
        logger.trace(s);
    }

    @Override
    public void trace(String s, Object obj) {
        logger.trace(s, obj);
    }

    @Override
    public void trace(String s, Object... aobj) {
        logger.trace(s, aobj);
    }

    @Override
    public void trace(String s, Throwable throwable) {
        logger.trace(s, throwable);
    }

    @Override
    public void trace(Marker marker, String s) {
        logger.trace(marker, s);
    }

    @Override
    public void trace(String s, Object obj, Object obj1) {
        logger.trace(s, obj, obj1);
    }

    @Override
    public void trace(Marker marker, String s, Object obj) {
        logger.trace(marker, s, obj);
    }

    @Override
    public void trace(Marker marker, String s, Object... aobj) {
        logger.trace(marker, s, aobj);
    }

    @Override
    public void trace(Marker marker, String s, Throwable throwable) {
        logger.trace(marker, s, throwable);
    }

    @Override
    public void trace(Marker marker, String s, Object obj, Object obj1) {
        logger.trace(marker, s, obj, obj1);
    }

    @Override
    public void warn(String s) {
        logger.warn(s);
    }

    @Override
    public void warn(String s, Object obj) {
        logger.warn(s, obj);
    }

    @Override
    public void warn(String s, Object... aobj) {
        logger.warn(s, aobj);
    }

    @Override
    public void warn(String s, Throwable throwable) {
        logger.warn(s, throwable);
    }

    @Override
    public void warn(Marker marker, String s) {
        logger.warn(marker, s);
    }

    @Override
    public void warn(String s, Object obj, Object obj1) {
        logger.warn(s, obj, obj1);
    }

    @Override
    public void warn(Marker marker, String s, Object obj) {
        logger.warn(marker, s, obj);
    }

    @Override
    public void warn(Marker marker, String s, Object... aobj) {
        logger.warn(marker, s, aobj);
    }

    @Override
    public void warn(Marker marker, String s, Throwable throwable) {
        logger.warn(marker, s, throwable);
    }

    @Override
    public void warn(Marker marker, String s, Object obj, Object obj1) {
        logger.warn(marker, s, obj, obj1);
    }

    @Override
    public void trace(int logType, String msg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "trace", msg, null, optId, optName));

        logger.trace(msg);
    }

    @Override
    public void trace(int logType, LoggerExtData extData, String msg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "trace", msg, null, optId, optName));

        logger.trace(msg);
    }

    @Override
    public void trace(int logType, String format, Object arg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "trace", format, new Object[]{arg}, optId, optName));

        logger.trace(format, arg);
    }

    @Override
    public void trace(int logType, LoggerExtData extData, String format, Object arg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "trace", format, new Object[]{arg}, optId, optName));

        logger.trace(format, arg);
    }

    @Override
    public void trace(int logType, String format, Object arg1, Object arg2, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "trace", format, new Object[]{arg1, arg2}, optId, optName));

        logger.trace(format, arg1, arg2);
    }

    @Override
    public void trace(int logType, LoggerExtData extData, String format, Object arg1, Object arg2, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "trace", format, new Object[]{arg1, arg2}, optId, optName));

        logger.trace(format, arg1, arg2);
    }

    @Override
    public void trace(int logType, String format, Long optId, String optName, Object... arguments) {
        LoggerFactory.dispatchListener(buildEvent(logType, "trace", format, arguments, optId, optName));

        logger.trace(format, arguments);
    }

    @Override
    public void trace(int logType, LoggerExtData extData, String format, Long optId, String optName, Object... arguments) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "trace", format, arguments, optId, optName));

        logger.trace(format, arguments);
    }

    @Override
    public void trace(int logType, String msg, Throwable t, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "trace", msg, null, optId, optName));

        logger.trace(msg, t);
    }

    @Override
    public void trace(int logType, LoggerExtData extData, String msg, Throwable t, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "trace", msg, null, optId, optName));

        logger.trace(msg, t);
    }

    @Override
    public void trace(int logType, Marker marker, String msg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "trace", msg, null, optId, optName));

        logger.trace(marker, msg);
    }

    @Override
    public void trace(int logType, LoggerExtData extData, Marker marker, String msg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "trace", msg, null, optId, optName));

        logger.trace(marker, msg);
    }

    @Override
    public void trace(int logType, Marker marker, String format, Object arg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "trace", format, new Object[]{arg}, optId, optName));

        logger.trace(marker, format, arg);
    }

    @Override
    public void trace(int logType, LoggerExtData extData, Marker marker, String format, Object arg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "trace", format, new Object[]{arg}, optId, optName));

        logger.trace(marker, format, arg);
    }

    @Override
    public void trace(int logType, Marker marker, String format, Object arg1, Object arg2, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "trace", format, new Object[]{arg1, arg2}, optId, optName));

        logger.trace(marker, format, arg1, arg2);
    }

    @Override
    public void trace(int logType, LoggerExtData extData, Marker marker, String format, Object arg1, Object arg2, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "trace", format, new Object[]{arg1, arg2}, optId, optName));

        logger.trace(marker, format, arg1, arg2);
    }

    @Override
    public void trace(int logType, Marker marker, String format, Long optId, String optName, Object... argArray) {
        LoggerFactory.dispatchListener(buildEvent(logType, "trace", format, argArray, optId, optName));

        logger.trace(marker, format, argArray);
    }

    @Override
    public void trace(int logType, LoggerExtData extData, Marker marker, String format, Long optId, String optName, Object... argArray) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "trace", format, argArray, optId, optName));

        logger.trace(marker, format, argArray);
    }

    @Override
    public void trace(int logType, Marker marker, String msg, Throwable t, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "trace", msg, null, optId, optName));

        logger.trace(marker, msg, t);
    }

    @Override
    public void trace(int logType, LoggerExtData extData, Marker marker, String msg, Throwable t, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "trace", msg, null, optId, optName));

        logger.trace(marker, msg, t);
    }

    @Override
    public void debug(int logType, String s, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "debug", s, null, optId, optName));

        logger.debug(s);
    }

    @Override
    public void debug(int logType, LoggerExtData extData, String s, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "debug", s, null, optId, optName));

        logger.debug(s);
    }

    @Override
    public void debug(int logType, String s, Object obj, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "debug", s, new Object[]{obj}, optId, optName));

        logger.debug(s);
    }

    @Override
    public void debug(int logType, LoggerExtData extData, String s, Object obj, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "debug", s, new Object[]{obj}, optId, optName));

        logger.debug(s);
    }

    @Override
    public void debug(int logType, String s, Long optId, String optName, Object... obj) {
        LoggerFactory.dispatchListener(buildEvent(logType, "debug", s, obj, optId, optName));

        logger.debug(s, obj);
    }

    @Override
    public void debug(int logType, LoggerExtData extData, String s, Long optId, String optName, Object... obj) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "debug", s, obj, optId, optName));

        logger.debug(s, obj);
    }

    @Override
    public void debug(int logType, String s, Throwable throwable, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "debug", s, null, optId, optName));

        logger.debug(s, throwable);
    }

    @Override
    public void debug(int logType, LoggerExtData extData, String s, Throwable throwable, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "debug", s, null, optId, optName));

        logger.debug(s, throwable);
    }

    @Override
    public void debug(int logType, String format, Object arg1, Object arg2, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "debug", format, new Object[]{arg1, arg2}, optId, optName));

        logger.debug(format, arg1, arg2);
    }

    @Override
    public void debug(int logType, LoggerExtData extData, String format, Object arg1, Object arg2, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "debug", format, new Object[]{arg1, arg2}, optId, optName));

        logger.debug(format, arg1, arg2);
    }

    @Override
    public void debug(int logType, Marker marker, String msg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "debug", msg, null, optId, optName));

        logger.debug(marker, msg);
    }

    @Override
    public void debug(int logType, LoggerExtData extData, Marker marker, String msg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "debug", msg, null, optId, optName));

        logger.debug(marker, msg);
    }

    @Override
    public void debug(int logType, Marker marker, String format, Object arg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "debug", format, new Object[]{arg}, optId, optName));

        logger.debug(marker, format, arg);
    }

    @Override
    public void debug(int logType, LoggerExtData extData, Marker marker, String format, Object arg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "debug", format, new Object[]{arg}, optId, optName));

        logger.debug(marker, format, arg);
    }

    @Override
    public void debug(int logType, Marker marker, String format, Object arg1, Object arg2, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "debug", format, new Object[]{arg1, arg2}, optId, optName));

        logger.debug(marker, format, arg1, arg2);
    }

    @Override
    public void debug(int logType, LoggerExtData extData, Marker marker, String format, Object arg1, Object arg2, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "debug", format, new Object[]{arg1, arg2}, optId, optName));

        logger.debug(marker, format, arg1, arg2);
    }

    @Override
    public void debug(int logType, Marker marker, String format, Long optId, String optName, Object... arguments) {
        LoggerFactory.dispatchListener(buildEvent(logType, "debug", format, arguments, optId, optName));

        logger.debug(marker, format, arguments);
    }

    @Override
    public void debug(int logType, LoggerExtData extData, Marker marker, String format, Long optId, String optName, Object... arguments) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "debug", format, arguments, optId, optName));

        logger.debug(marker, format, arguments);
    }

    @Override
    public void debug(int logType, Marker marker, String msg, Throwable t, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "debug", msg, null, optId, optName));

        logger.debug(marker, msg, t);
    }

    @Override
    public void debug(int logType, LoggerExtData extData, Marker marker, String msg, Throwable t, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "debug", msg, null, optId, optName));

        logger.debug(marker, msg, t);
    }

    @Override
    public void info(int logType, String msg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "info", msg, null, optId, optName));

        logger.info(msg);
    }

    @Override
    public void info(int logType, LoggerExtData extData, String msg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "info", msg, null, optId, optName));

        logger.info(msg);
    }

    @Override
    public void info(int logType, String format, Object arg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "info", format, new Object[]{arg}, optId, optName));

        logger.info(format, arg);
    }

    @Override
    public void info(int logType, LoggerExtData extData, String format, Object arg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "info", format, new Object[]{arg}, optId, optName));

        logger.info(format, arg);
    }

    @Override
    public void info(int logType, String format, Object arg1, Object arg2, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "info", format, new Object[]{arg1, arg2}, optId, optName));

        logger.info(format, arg1, arg2);
    }

    @Override
    public void info(int logType, LoggerExtData extData, String format, Object arg1, Object arg2, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "info", format, new Object[]{arg1, arg2}, optId, optName));

        logger.info(format, arg1, arg2);
    }

    @Override
    public void info(int logType, String format, Long optId, String optName, Object... arguments) {
        LoggerFactory.dispatchListener(buildEvent(logType, "info", format, arguments, optId, optName));

        logger.info(format, arguments);
    }

    @Override
    public void info(int logType, LoggerExtData extData, String format, Long optId, String optName, Object... arguments) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "info", format, arguments, optId, optName));

        logger.info(format, arguments);
    }

    @Override
    public void info(int logType, String msg, Throwable t, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "info", msg, null, optId, optName));

        logger.info(msg, t);
    }

    @Override
    public void info(int logType, LoggerExtData extData, String msg, Throwable t, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "info", msg, null, optId, optName));

        logger.info(msg, t);
    }

    @Override
    public void info(int logType, Marker marker, String msg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "info", msg, null, optId, optName));

        logger.info(marker, msg);
    }

    @Override
    public void info(int logType, LoggerExtData extData, Marker marker, String msg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "info", msg, null, optId, optName));

        logger.info(marker, msg);
    }

    @Override
    public void info(int logType, Marker marker, String format, Object arg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "info", format, new Object[]{arg}, optId, optName));

        logger.info(marker, format, arg);
    }

    @Override
    public void info(int logType, LoggerExtData extData, Marker marker, String format, Object arg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "info", format, new Object[]{arg}, optId, optName));

        logger.info(marker, format, arg);
    }

    @Override
    public void info(int logType, Marker marker, String format, Object arg1, Object arg2, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "info", format, new Object[]{arg1, arg2}, optId, optName));

        logger.info(marker, format, arg1, arg2);
    }

    @Override
    public void info(int logType, LoggerExtData extData, Marker marker, String format, Object arg1, Object arg2, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "info", format, new Object[]{arg1, arg2}, optId, optName));

        logger.info(marker, format, arg1, arg2);
    }

    @Override
    public void info(int logType, Marker marker, String format, Long optId, String optName, Object... arguments) {
        LoggerFactory.dispatchListener(buildEvent(logType, "info", format, arguments, optId, optName));

        logger.info(marker, format, arguments);
    }

    @Override
    public void info(int logType, LoggerExtData extData, Marker marker, String format, Long optId, String optName, Object... arguments) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "info", format, arguments, optId, optName));

        logger.info(marker, format, arguments);
    }

    @Override
    public void info(int logType, Marker marker, String msg, Throwable t, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "info", msg, null, optId, optName));

        logger.info(marker, msg, t);
    }

    @Override
    public void info(int logType, LoggerExtData extData, Marker marker, String msg, Throwable t, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "info", msg, null, optId, optName));

        logger.info(marker, msg, t);
    }

    @Override
    public void warn(int logType, String msg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "warn", msg, null, optId, optName));

        logger.warn(msg);
    }

    @Override
    public void warn(int logType, LoggerExtData extData, String msg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "warn", msg, null, optId, optName));

        logger.warn(msg);
    }

    @Override
    public void warn(int logType, String format, Object arg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "warn", format, new Object[]{arg}, optId, optName));

        logger.warn(format, arg);
    }

    @Override
    public void warn(int logType, LoggerExtData extData, String format, Object arg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "warn", format, new Object[]{arg}, optId, optName));

        logger.warn(format, arg);
    }

    @Override
    public void warn(int logType, String format, Long optId, String optName, Object... arguments) {
        LoggerFactory.dispatchListener(buildEvent(logType, "warn", format, arguments, optId, optName));

        logger.warn(format, arguments);
    }

    @Override
    public void warn(int logType, LoggerExtData extData, String format, Long optId, String optName, Object... arguments) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "warn", format, arguments, optId, optName));

        logger.warn(format, arguments);
    }

    @Override
    public void warn(int logType, String format, Object arg1, Object arg2, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "warn", format, new Object[]{arg1, arg2}, optId, optName));

        logger.warn(format, arg1, arg2);
    }

    @Override
    public void warn(int logType, LoggerExtData extData, String format, Object arg1, Object arg2, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "warn", format, new Object[]{arg1, arg2}, optId, optName));

        logger.warn(format, arg1, arg2);
    }

    @Override
    public void warn(int logType, String msg, Throwable t, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "warn", msg, null, optId, optName));

        logger.warn(msg, t);
    }

    @Override
    public void warn(int logType, LoggerExtData extData, String msg, Throwable t, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "warn", msg, null, optId, optName));

        logger.warn(msg, t);
    }

    @Override
    public void warn(int logType, Marker marker, String msg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "warn", msg, null, optId, optName));

        logger.warn(marker, msg);
    }

    @Override
    public void warn(int logType, LoggerExtData extData, Marker marker, String msg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "warn", msg, null, optId, optName));

        logger.warn(marker, msg);
    }

    @Override
    public void warn(int logType, Marker marker, String format, Object arg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "warn", format, new Object[]{arg}, optId, optName));

        logger.warn(marker, format, arg);
    }

    @Override
    public void warn(int logType, LoggerExtData extData, Marker marker, String format, Object arg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "warn", format, new Object[]{arg}, optId, optName));

        logger.warn(marker, format, arg);
    }

    @Override
    public void warn(int logType, Marker marker, String format, Object arg1, Object arg2, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "warn", format, new Object[]{arg1, arg2}, optId, optName));

        logger.warn(marker, format, arg1, arg2);
    }

    @Override
    public void warn(int logType, LoggerExtData extData, Marker marker, String format, Object arg1, Object arg2, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "warn", format, new Object[]{arg1, arg2}, optId, optName));

        logger.warn(marker, format, arg1, arg2);
    }

    @Override
    public void warn(int logType, Marker marker, String format, Long optId, String optName, Object... arguments) {
        LoggerFactory.dispatchListener(buildEvent(logType, "warn", format, arguments, optId, optName));

        logger.warn(marker, format, arguments);
    }

    @Override
    public void warn(int logType, LoggerExtData extData, Marker marker, String format, Long optId, String optName, Object... arguments) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "warn", format, arguments, optId, optName));

        logger.warn(marker, format, arguments);
    }

    @Override
    public void warn(int logType, Marker marker, String msg, Throwable t, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "warn", msg, null, optId, optName));

        logger.warn(marker, msg, t);
    }

    @Override
    public void warn(int logType, LoggerExtData extData, Marker marker, String msg, Throwable t, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "warn", msg, null, optId, optName));

        logger.warn(marker, msg, t);
    }

    @Override
    public void error(int logType, String msg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "error", msg, null, optId, optName));

        logger.error(msg);
    }

    @Override
    public void error(int logType, LoggerExtData extData, String msg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "error", msg, null, optId, optName));

        logger.error(msg);
    }

    @Override
    public void error(int logType, String format, Object arg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "error", format, new Object[]{arg}, optId, optName));

        logger.error(format, arg);
    }

    @Override
    public void error(int logType, LoggerExtData extData, String format, Object arg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "error", format, new Object[]{arg}, optId, optName));

        logger.error(format, arg);
    }

    @Override
    public void error(int logType, String format, Object arg1, Object arg2, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "error", format, new Object[]{arg1, arg2}, optId, optName));

        logger.error(format, arg1, arg2);
    }

    @Override
    public void error(int logType, LoggerExtData extData, String format, Object arg1, Object arg2, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "error", format, new Object[]{arg1, arg2}, optId, optName));

        logger.error(format, arg1, arg2);
    }

    @Override
    public void error(int logType, String format, Long optId, String optName, Object... arguments) {
        LoggerFactory.dispatchListener(buildEvent(logType, "error", format, arguments, optId, optName));

        logger.error(format, arguments);
    }

    @Override
    public void error(int logType, LoggerExtData extData, String format, Long optId, String optName, Object... arguments) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "error", format, arguments, optId, optName));

        logger.error(format, arguments);
    }

    @Override
    public void error(int logType, String msg, Throwable t, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "error", msg, null, optId, optName));

        logger.error(msg, t);
    }

    @Override
    public void error(int logType, LoggerExtData extData, String msg, Throwable t, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "error", msg, null, optId, optName));

        logger.error(msg, t);
    }

    @Override
    public void error(int logType, Marker marker, String msg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "error", msg, null, optId, optName));

        logger.error(marker, msg);
    }

    @Override
    public void error(int logType, LoggerExtData extData, Marker marker, String msg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "error", msg, null, optId, optName));

        logger.error(marker, msg);
    }

    @Override
    public void error(int logType, Marker marker, String format, Object arg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "error", format, new Object[]{arg}, optId, optName));

        logger.error(marker, format, arg);
    }

    @Override
    public void error(int logType, LoggerExtData extData, Marker marker, String format, Object arg, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "error", format, new Object[]{arg}, optId, optName));

        logger.error(marker, format, arg);
    }

    @Override
    public void error(int logType, Marker marker, String format, Object arg1, Object arg2, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "error", format, new Object[]{arg1, arg2}, optId, optName));

        logger.error(marker, format, arg1, arg2);
    }

    @Override
    public void error(int logType, LoggerExtData extData, Marker marker, String format, Object arg1, Object arg2, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "error", format, new Object[]{arg1, arg2}, optId, optName));

        logger.error(marker, format, arg1, arg2);
    }

    @Override
    public void error(int logType, Marker marker, String format, Long optId, String optName, Object... arguments) {
        LoggerFactory.dispatchListener(buildEvent(logType, "error", format, arguments, optId, optName));

        logger.error(marker, format, arguments);
    }

    @Override
    public void error(int logType, LoggerExtData extData, Marker marker, String format, Long optId, String optName, Object... arguments) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "error", format, arguments, optId, optName));

        logger.error(marker, format, arguments);
    }

    @Override
    public void error(int logType, Marker marker, String msg, Throwable t, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, "error", msg, null, optId, optName));

        logger.error(marker, msg, t);
    }

    @Override
    public void error(int logType, LoggerExtData extData, Marker marker, String msg, Throwable t, Long optId, String optName) {
        LoggerFactory.dispatchListener(buildEvent(logType, extData, "error", msg, null, optId, optName));

        logger.error(marker, msg, t);
    }

}
